<?php
/* @var $this ShiftChangeController */
/* @var $model ShiftChange */




if($model->is_swap){

	$this->breadcrumbs=array(
		'Q-Shifts'=>array('/qshift/'),
		'Swap Management'=>array('/shiftChange/swap_management/'),
		'Viewing',
		$model->idshift_change,
	);

	if ($model->isStatusCancellable($model->day_requested)){

		$this->menu=array(
			array('label'=>'Cancel Swap', 'url'=>'#', 'linkOptions'=>array('submit'=>array('cancelSwap','id'=>$model->idshift_change),'confirm'=>'Are you sure you want to cancel this Swap?')),
			array('label'=>'Go to Swap Management', 'url'=>array('swap_management')),
		);
	} else {
		$this->menu=array(
			array('label'=>'Go to Swap Management', 'url'=>array('swap_management')),
		);
	}

} else {

	$this->breadcrumbs=array(
		'Shifts'=>array('/shift/'),
		'Change Management'=>array('/shiftChange/change_management/'),
		'Viewing',
		$model->idshift_change,
	);

	if ($model->isStatusCancellable($model->day_requested)){
			
		$this->menu=array(
			array('label'=>'Create Shift Change', 'url'=>array('create')),
			array('label'=>'Cancel Shift Change', 'url'=>'#', 'linkOptions'=>array('submit'=>array('cancel','id'=>$model->idshift_change),'confirm'=>'Are you sure you want to cancel this Shift Change?')),
			array('label'=>'Go to Shift Change Management', 'url'=>array('change_management')),
		);
	} else {
		$this->menu=array(
			array('label'=>'Create Shift Change', 'url'=>array('create')),
			array('label'=>'Go to Shift Change Management', 'url'=>array('change_management')),
		);
	}
}

?>

<h1>Viewing <?php echo ($model->is_swap)? "Qshift Swap" : "Shift Change" ; ?> for <?php echo $model->day_requested; ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		//'idshift_change',
		array(
			'name'=>'Requestor',
			'value'=>$model->requestingUser_relation->fullname),	
		array(
			'name'=>'Requestor\'s Shift',
			'value'=>($model->current_shift != null)? $model->getCurrentShift() : null),		
		array(
			'name'=>'Requested Shift',
			'value'=>$model->requestedShift_relation->name),	
		array(
			'name'=>'Requested Q-Shift',
			'value'=>$model->requestedQshift_relation->name),				
		'day_requested',
		array(
			'name'=>'Status',
			'value'=>$model->getStatus($model->request_status)),	
		array(
			'name'=>'Target User',
			'value'=>$model->getTargetUserFullName()),	
		array(
			'name'=>'Is a Swap?',
			'value'=>User::getYesNoValue($model->is_swap)),
			
		'comments',
	),
)); ?>
